package net.esj.background.struts2.view.easyui;

import net.esj.background.Constants;
import net.esj.background.manage.LoginManage;
import net.esj.background.manage.MenuManage;
import net.esj.background.support.multi.Portal;
import net.esj.basic.core.engine.config.MelonConfig;
import net.esj.basic.utils.Validators;
import net.esj.basic.view.BaseAction;

public abstract class AbstractBgAction extends BaseAction implements Constants{

	protected MenuManage menuManage;
	
	protected LoginManage loginManage;
	
	protected Portal portal;
	
	public String getTemplate(){
		return portal.getTemplate();
	}
	
	public String getTheme() {
		return portal.getTheme();
	}
	
	@Override
	protected String[] getDefaultSources() {
		String str  = MelonConfig.getProperty(PROPERTY_DEFAULT_MESSAGE);
		if(Validators.isEmpty(str)){
			return null;
		}
		return new String[]{str};
	}

	public void setMenuManage(MenuManage menuManage) {
		this.menuManage = menuManage;
	}

	public void setLoginManage(LoginManage loginManage) {
		this.loginManage = loginManage;
	}

	public void setPortal(Portal portal) {
		this.portal = portal;
	}
	
}
